home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / Interfaces & Libraries / Interfaces / AIncludes / Sound.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  25.4 KB  |  907 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Sound.a
  3. ;
  4. ;    Contains:    Sound Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Sound Manager 3.1
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  21. __SOUND__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  30.     include 'Components.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33.  
  34.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  35.     include 'MixedMode.a'
  36.     ENDIF
  37. ;
  38. ;                        * * *  N O T E  * * *
  39. ;
  40. ;    This file has been updated to include Sound Manager 3.1 interfaces.
  41. ;
  42. ;    Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  43. ;    that originally shipped with the PowerMacs. These missing functions and the
  44. ;    new 3.1 interfaces have been released in the SoundLib library for PowerPC
  45. ;    developers to link with. The runtime library for these functions are
  46. ;    installed by Sound Manager 3.1. The following functions are found in SoundLib.
  47. ;
  48. ;        GetCompressionInfo, GetSoundPreference, SetSoundPreference,
  49. ;        UnsignedFixedMulDiv, SndGetInfo, SndSetInfo
  50. ;
  51. ;
  52. ;    Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  53. ;
  54. ;    These items are no longer defined, but appear here so that someone
  55. ;    searching the interfaces might find them. If you are using one of these
  56. ;    items, you must change your code to support the Sound Manager.
  57. ;
  58. ;        swMode, ftMode, ffMode
  59. ;        FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  60. ;        SndCompletionProcPtr
  61. ;        StartSound, StopSound, SoundDone
  62. ;
  63.  
  64. soundListRsrc                    EQU        'snd '                ;Resource type used by Sound Manager
  65. rate44khz                        EQU        $AC440000            ;44100.00000 in fixed-point
  66. rate22050hz                        EQU        $56220000            ;22050.00000 in fixed-point
  67. rate22khz                        EQU        $56EE8BA3            ;22254.54545 in fixed-point
  68. rate11khz                        EQU        $2B7745D1            ;11127.27273 in fixed-point
  69. rate11025hz                        EQU        $2B110000            ;11025.00000 in fixed-point
  70. ;synthesizer numbers for SndNewChannel
  71. squareWaveSynth                    EQU        1                    ;square wave synthesizer
  72. waveTableSynth                    EQU        3                    ;wave table synthesizer
  73. sampledSynth                    EQU        5                    ;sampled sound synthesizer
  74. ;old Sound Manager MACE synthesizer numbers
  75. MACE3snthID                        EQU        11
  76. MACE6snthID                        EQU        13
  77. kMiddleC                        EQU        60                    ;MIDI note value for middle C
  78. kSimpleBeepID                    EQU        1                    ;reserved resource ID for Simple Beep
  79. kFullVolume                        EQU        $0100                ;1.0, setting for full hardware output volume
  80. kNoVolume                        EQU        0                    ;setting for no sound volume
  81. ;command numbers for SndDoCommand and SndDoImmediate
  82. nullCmd                            EQU        0
  83. initCmd                            EQU        1
  84. freeCmd                            EQU        2
  85. quietCmd                        EQU        3
  86. flushCmd                        EQU        4
  87. reInitCmd                        EQU        5
  88. waitCmd                            EQU        10
  89. pauseCmd                        EQU        11
  90. resumeCmd                        EQU        12
  91. callBackCmd                        EQU        13
  92.  
  93. syncCmd                            EQU        14
  94. availableCmd                    EQU        24
  95. versionCmd                        EQU        25
  96. totalLoadCmd                    EQU        26
  97. loadCmd                            EQU        27
  98. freqDurationCmd                    EQU        40
  99. restCmd                            EQU        41
  100. freqCmd                            EQU        42
  101. ampCmd                            EQU        43
  102. timbreCmd                        EQU        44
  103. getAmpCmd                        EQU        45
  104. volumeCmd                        EQU        46                    ;sound manager 3.0 or later only
  105. getVolumeCmd                    EQU        47                    ;sound manager 3.0 or later only
  106. waveTableCmd                    EQU        60
  107. phaseCmd                        EQU        61
  108.  
  109. soundCmd                        EQU        80
  110. bufferCmd                        EQU        81
  111. rateCmd                            EQU        82
  112. continueCmd                        EQU        83
  113. doubleBufferCmd                    EQU        84
  114. getRateCmd                        EQU        85
  115. rateMultiplierCmd                EQU        86
  116. getRateMultiplierCmd            EQU        87
  117. sizeCmd                            EQU        90
  118. convertCmd                        EQU        91
  119. stdQLength                        EQU        128
  120. dataOffsetFlag                    EQU        $8000
  121.  
  122. ;channel initialization parameters
  123.     IF OLDROUTINENAMES  THEN
  124. waveInitChannelMask                EQU        $07
  125. waveInitChannel0                EQU        $04                    ;wave table only, Sound Manager 2.0 and earlier
  126. waveInitChannel1                EQU        $05                    ;wave table only, Sound Manager 2.0 and earlier
  127. waveInitChannel2                EQU        $06                    ;wave table only, Sound Manager 2.0 and earlier
  128. waveInitChannel3                EQU        $07                    ;wave table only, Sound Manager 2.0 and earlier
  129. initChan0                        EQU        waveInitChannel0    ;obsolete spelling
  130. initChan1                        EQU        waveInitChannel1    ;obsolete spelling
  131. initChan2                        EQU        waveInitChannel2    ;obsolete spelling
  132. initChan3                        EQU        waveInitChannel3    ;obsolete spelling
  133.  
  134.     ENDIF
  135. initChanLeft                    EQU        $0002                ;left stereo channel
  136. initChanRight                    EQU        $0003                ;right stereo channel
  137. initNoInterp                    EQU        $0004                ;no linear interpolation
  138. initNoDrop                        EQU        $0008                ;no drop-sample conversion
  139. initMono                        EQU        $0080                ;monophonic channel
  140. initStereo                        EQU        $00C0                ;stereo channel
  141. initMACE3                        EQU        $0300                ;MACE 3:1
  142. initMACE6                        EQU        $0400                ;MACE 6:1
  143. initPanMask                        EQU        $0003                ;mask for right/left pan values
  144. initSRateMask                    EQU        $0030                ;mask for sample rate values
  145. initStereoMask                    EQU        $00C0                ;mask for mono/stereo values
  146. initCompMask                    EQU        $FF00                ;mask for compression IDs
  147. kUseOptionalOutputDevice        EQU        -1                    ;only for Sound Manager 3.0 or later
  148. notCompressed                    EQU        0                    ;compression ID's
  149. fixedCompression                EQU        -1                    ;compression ID for fixed-sized compression
  150. variableCompression                EQU        -2                    ;compression ID for variable-sized compression
  151. twoToOne                        EQU        1
  152. eightToThree                    EQU        2
  153. threeToOne                        EQU        3
  154. sixToOne                        EQU        4
  155.  
  156.     IF ¬ GENERATINGPOWERPC  THEN
  157. stdSH                            EQU        $00                    ;Standard sound header encode value
  158. extSH                            EQU        $FF                    ;Extended sound header encode value
  159. cmpSH                            EQU        $FE                    ;Compressed sound header encode value
  160.  
  161.     ENDIF
  162. outsideCmpSH                    EQU        0                    ;MACE constants
  163. insideCmpSH                        EQU        1
  164. aceSuccess                        EQU        0
  165. aceMemFull                        EQU        1
  166. aceNilBlock                        EQU        2
  167. aceBadComp                        EQU        3
  168. aceBadEncode                    EQU        4
  169. aceBadDest                        EQU        5
  170. aceBadCmd                        EQU        6
  171. sixToOnePacketSize                EQU        8
  172. threeToOnePacketSize            EQU        16
  173. stateBlockSize                    EQU        64
  174. leftOverBlockSize                EQU        32
  175. firstSoundFormat                EQU        $0001                ;general sound format
  176. secondSoundFormat                EQU        $0002                ;special sampled sound format (HyperCard)
  177. dbBufferReady                    EQU        $00000001            ;double buffer is filled
  178. dbLastBuffer                    EQU        $00000004            ;last double buffer to play
  179. sysBeepDisable                    EQU        $0000                ;SysBeep() enable flags
  180. sysBeepEnable                    EQU        (1 << 0)
  181. sysBeepSynchronous                EQU        (1 << 1)            ;if bit set, make alert sounds synchronous
  182. unitTypeNoSelection                EQU        $FFFF                ;unitTypes for AudioSelection.unitType
  183. unitTypeSeconds                    EQU        $0000
  184.  
  185. ; unsigned fixed-point number 
  186. ; typedef unsigned long     UnsignedFixed
  187. SndCommand                 RECORD    0
  188. cmd                         ds.w   1        ; offset: $0 (0)
  189. param1                     ds.w   1        ; offset: $2 (2)
  190. param2                     ds.l   1        ; offset: $4 (4)
  191. sizeof                     EQU *            ; size:   $8 (8)
  192.                         ENDR
  193.  
  194. ; typedef struct SndCommand  SndCommand
  195. ; typedef struct SndChannel  SndChannel
  196. ; typedef SndChannel         *SndChannelPtr
  197. SndChannel                 RECORD    0
  198. nextChan                 ds.l   1        ; offset: $0 (0)
  199. firstMod                 ds.l   1        ; offset: $4 (4)        ; reserved for the Sound Manager 
  200. callBack                 ds.l   1        ; offset: $8 (8)
  201. userInfo                 ds.l   1        ; offset: $C (12)
  202. wait                     ds.l   1        ; offset: $10 (16)        ; The following is for internal Sound Manager use only.
  203. cmdInProgress             ds     SndCommand ; offset: $14 (20)
  204. flags                     ds.w   1        ; offset: $1C (28)
  205. qLength                     ds.w   1        ; offset: $1E (30)
  206. qHead                     ds.w   1        ; offset: $20 (32)
  207. qTail                     ds.w   1        ; offset: $22 (34)
  208. queue                     ds.b   128 * SndCommand.sizeof ; offset: $24 (36)
  209. sizeof                     EQU *            ; size:   $424 (1060)
  210.                         ENDR
  211.  
  212. ;MACE structures
  213. StateBlock                 RECORD    0
  214. stateVar                 ds.w   64        ; offset: $0 (0)
  215. sizeof                     EQU *            ; size:   $80 (128)
  216.                         ENDR
  217.  
  218. ; typedef struct StateBlock  StateBlock
  219. ; typedef StateBlock         *StateBlockPtr
  220. LeftOverBlock             RECORD    0
  221. count                     ds.l   1        ; offset: $0 (0)
  222. sampleArea                 ds.b   32        ; offset: $4 (4)
  223. sizeof                     EQU *            ; size:   $24 (36)
  224.                         ENDR
  225.  
  226. ; typedef struct LeftOverBlock  LeftOverBlock
  227. ; typedef LeftOverBlock     *LeftOverBlockPtr
  228. ModRef                     RECORD    0
  229. modNumber                 ds.w   1        ; offset: $0 (0)
  230. modInit                     ds.l   1        ; offset: $2 (2)
  231. sizeof                     EQU *            ; size:   $6 (6)
  232.                         ENDR
  233.  
  234. ; typedef struct ModRef     ModRef
  235. SndListResource         RECORD    0
  236. format                     ds.w   1        ; offset: $0 (0)
  237. numModifiers             ds.w   1        ; offset: $2 (2)
  238. modifierPart             ds     ModRef    ; offset: $4 (4)        ;This is a variable length array
  239. numCommands                 ds.w   1        ; offset: $A (10)
  240. commandPart                 ds     SndCommand ; offset: $C (12)    ;This is a variable length array
  241. dataPart                 ds.b   1        ; offset: $14 (20)        ;This is a variable length array
  242.                          ORG 22
  243. sizeof                     EQU *            ; size:   $16 (22)
  244.                         ENDR
  245.  
  246. ; typedef struct SndListResource  SndListResource
  247. ; typedef SndListResource     *SndListPtr
  248. ; typedef SndListPtr         *SndListHndl, *SndListHandle
  249. ;HyperCard sound resource format
  250. Snd2ListResource         RECORD    0
  251. format                     ds.w   1        ; offset: $0 (0)
  252. refCount                 ds.w   1        ; offset: $2 (2)
  253. numCommands                 ds.w   1        ; offset: $4 (4)
  254. commandPart                 ds     SndCommand ; offset: $6 (6)        ;This is a variable length array
  255. dataPart                 ds.b   1        ; offset: $E (14)        ;This is a variable length array
  256.                          ORG 16
  257. sizeof                     EQU *            ; size:   $10 (16)
  258.                         ENDR
  259.  
  260. ; typedef struct Snd2ListResource  Snd2ListResource
  261. ; typedef Snd2ListResource     *Snd2ListPtr
  262. ; typedef Snd2ListPtr         *Snd2ListHndl, *Snd2ListHandle
  263. SoundHeader             RECORD    0
  264. samplePtr                 ds.l   1        ; offset: $0 (0)        ;if NIL then samples are in sampleArea
  265. length                     ds.l   1        ; offset: $4 (4)        ;length of sound in bytes
  266. sampleRate                 ds.l   1        ; offset: $8 (8)        ;sample rate for this sound
  267. loopStart                 ds.l   1        ; offset: $C (12)        ;start of looping portion
  268. loopEnd                     ds.l   1        ; offset: $10 (16)        ;end of looping portion
  269. encode                     ds.b   1        ; offset: $14 (20)        ;header encoding
  270. baseFrequency             ds.b   1        ; offset: $15 (21)        ;baseFrequency value
  271. sampleArea                 ds.b   1        ; offset: $16 (22)        ;space for when samples follow directly
  272.                          ORG 24
  273. sizeof                     EQU *            ; size:   $18 (24)
  274.                         ENDR
  275.  
  276. ; typedef struct SoundHeader  SoundHeader
  277. ; typedef SoundHeader         *SoundHeaderPtr
  278. CmpSoundHeader             RECORD    0
  279. samplePtr                 ds.l   1        ; offset: $0 (0)        ;if nil then samples are in sample area
  280. numChannels                 ds.l   1        ; offset: $4 (4)        ;number of channels i.e. mono = 1
  281. sampleRate                 ds.l   1        ; offset: $8 (8)        ;sample rate in Apples Fixed point representation
  282. loopStart                 ds.l   1        ; offset: $C (12)        ;loopStart of sound before compression
  283. loopEnd                     ds.l   1        ; offset: $10 (16)        ;loopEnd of sound before compression
  284. encode                     ds.b   1        ; offset: $14 (20)        ;data structure used , stdSH, extSH, or cmpSH
  285. baseFrequency             ds.b   1        ; offset: $15 (21)        ;same meaning as regular SoundHeader
  286. numFrames                 ds.l   1        ; offset: $16 (22)        ;length in frames ( packetFrames or sampleFrames )
  287. AIFFSampleRate             ds.w   5        ; offset: $1A (26)        ;IEEE sample rate
  288. markerChunk                 ds.l   1        ; offset: $24 (36)        ;sync track
  289. format                     ds.l   1        ; offset: $28 (40)        ;data format type, was futureUse1
  290. futureUse2                 ds.l   1        ; offset: $2C (44)        ;reserved by Apple
  291. stateVars                 ds.l   1        ; offset: $30 (48)        ;pointer to State Block
  292. leftOverSamples             ds.l   1        ; offset: $34 (52)        ;used to save truncated samples between compression calls
  293. compressionID             ds.w   1        ; offset: $38 (56)        ;0 means no compression, non zero means compressionID
  294. packetSize                 ds.w   1        ; offset: $3A (58)        ;number of bits in compressed sample packet
  295. snthID                     ds.w   1        ; offset: $3C (60)        ;resource ID of Sound Manager snth that contains NRT C/E
  296. sampleSize                 ds.w   1        ; offset: $3E (62)        ;number of bits in non-compressed sample
  297. sampleArea                 ds.b   1        ; offset: $40 (64)        ;space for when samples follow directly
  298.                          ORG 66
  299. sizeof                     EQU *            ; size:   $42 (66)
  300.                         ENDR
  301.  
  302. ; typedef struct CmpSoundHeader  CmpSoundHeader
  303. ; typedef CmpSoundHeader     *CmpSoundHeaderPtr
  304. ExtSoundHeader             RECORD    0
  305. samplePtr                 ds.l   1        ; offset: $0 (0)        ;if nil then samples are in sample area
  306. numChannels                 ds.l   1        ; offset: $4 (4)        ;number of channels,  ie mono = 1
  307. sampleRate                 ds.l   1        ; offset: $8 (8)        ;sample rate in Apples Fixed point representation
  308. loopStart                 ds.l   1        ; offset: $C (12)        ;same meaning as regular SoundHeader
  309. loopEnd                     ds.l   1        ; offset: $10 (16)        ;same meaning as regular SoundHeader
  310. encode                     ds.b   1        ; offset: $14 (20)        ;data structure used , stdSH, extSH, or cmpSH
  311. baseFrequency             ds.b   1        ; offset: $15 (21)        ;same meaning as regular SoundHeader
  312. numFrames                 ds.l   1        ; offset: $16 (22)        ;length in total number of frames
  313. AIFFSampleRate             ds.w   5        ; offset: $1A (26)        ;IEEE sample rate
  314. markerChunk                 ds.l   1        ; offset: $24 (36)        ;sync track
  315. instrumentChunks         ds.l   1        ; offset: $28 (40)        ;AIFF instrument chunks
  316. AESRecording             ds.l   1        ; offset: $2C (44)
  317. sampleSize                 ds.w   1        ; offset: $30 (48)        ;number of bits in sample
  318. futureUse1                 ds.w   1        ; offset: $32 (50)        ;reserved by Apple
  319. futureUse2                 ds.l   1        ; offset: $34 (52)        ;reserved by Apple
  320. futureUse3                 ds.l   1        ; offset: $38 (56)        ;reserved by Apple
  321. futureUse4                 ds.l   1        ; offset: $3C (60)        ;reserved by Apple
  322. sampleArea                 ds.b   1        ; offset: $40 (64)        ;space for when samples follow directly
  323.                          ORG 66
  324. sizeof                     EQU *            ; size:   $42 (66)
  325.                         ENDR
  326.  
  327. ; typedef struct ExtSoundHeader  ExtSoundHeader
  328. ; typedef ExtSoundHeader     *ExtSoundHeaderPtr
  329. ConversionBlock         RECORD    0
  330. destination                 ds.w   1        ; offset: $0 (0)
  331. unused                     ds.w   1        ; offset: $2 (2)
  332. inputPtr                 ds.l   1        ; offset: $4 (4)
  333. outputPtr                 ds.l   1        ; offset: $8 (8)
  334. sizeof                     EQU *            ; size:   $C (12)
  335.                         ENDR
  336.  
  337. ; typedef struct ConversionBlock  ConversionBlock
  338. ; typedef ConversionBlock     *ConversionBlockPtr
  339. SMStatus                 RECORD    0
  340. smMaxCPULoad             ds.w   1        ; offset: $0 (0)
  341. smNumChannels             ds.w   1        ; offset: $2 (2)
  342. smCurCPULoad             ds.w   1        ; offset: $4 (4)
  343. sizeof                     EQU *            ; size:   $6 (6)
  344.                         ENDR
  345.  
  346. ; typedef struct SMStatus     SMStatus
  347. ; typedef SMStatus             *SMStatusPtr
  348. SCStatus                 RECORD    0
  349. scStartTime                 ds.l   1        ; offset: $0 (0)
  350. scEndTime                 ds.l   1        ; offset: $4 (4)
  351. scCurrentTime             ds.l   1        ; offset: $8 (8)
  352. scChannelBusy             ds.b   1        ; offset: $C (12)
  353. scChannelDisposed         ds.b   1        ; offset: $D (13)
  354. scChannelPaused             ds.b   1        ; offset: $E (14)
  355. scUnused                 ds.b   1        ; offset: $F (15)
  356. scChannelAttributes         ds.l   1        ; offset: $10 (16)
  357. scCPULoad                 ds.l   1        ; offset: $14 (20)
  358. sizeof                     EQU *            ; size:   $18 (24)
  359.                         ENDR
  360.  
  361. ; typedef struct SCStatus     SCStatus
  362. ; typedef SCStatus             *SCStatusPtr
  363. AudioSelection             RECORD    0
  364. unitType                 ds.l   1        ; offset: $0 (0)
  365. selStart                 ds.l   1        ; offset: $4 (4)
  366. selEnd                     ds.l   1        ; offset: $8 (8)
  367. sizeof                     EQU *            ; size:   $C (12)
  368.                         ENDR
  369.  
  370. ; typedef struct AudioSelection  AudioSelection
  371. ; typedef AudioSelection     *AudioSelectionPtr
  372. SndDoubleBuffer         RECORD    0
  373. dbNumFrames                 ds.l   1        ; offset: $0 (0)
  374. dbFlags                     ds.l   1        ; offset: $4 (4)
  375. dbUserInfo                 ds.l   2        ; offset: $8 (8)
  376. dbSoundData                 ds.b   1        ; offset: $10 (16)
  377.                          ORG 18
  378. sizeof                     EQU *            ; size:   $12 (18)
  379.                         ENDR
  380.  
  381. ; typedef struct SndDoubleBuffer  SndDoubleBuffer
  382. ; typedef SndDoubleBuffer     *SndDoubleBufferPtr
  383. SndDoubleBufferHeader     RECORD    0
  384. dbhNumChannels             ds.w   1        ; offset: $0 (0)
  385. dbhSampleSize             ds.w   1        ; offset: $2 (2)
  386. dbhCompressionID         ds.w   1        ; offset: $4 (4)
  387. dbhPacketSize             ds.w   1        ; offset: $6 (6)
  388. dbhSampleRate             ds.l   1        ; offset: $8 (8)
  389. dbhBufferPtr             ds.l   2        ; offset: $C (12)
  390. dbhDoubleBack             ds.l   1        ; offset: $14 (20)
  391. sizeof                     EQU *            ; size:   $18 (24)
  392.                         ENDR
  393.  
  394. ; typedef struct SndDoubleBufferHeader  SndDoubleBufferHeader
  395. ; typedef SndDoubleBufferHeader  *SndDoubleBufferHeaderPtr
  396. SndDoubleBufferHeader2     RECORD    0
  397. dbhNumChannels             ds.w   1        ; offset: $0 (0)
  398. dbhSampleSize             ds.w   1        ; offset: $2 (2)
  399. dbhCompressionID         ds.w   1        ; offset: $4 (4)
  400. dbhPacketSize             ds.w   1        ; offset: $6 (6)
  401. dbhSampleRate             ds.l   1        ; offset: $8 (8)
  402. dbhBufferPtr             ds.l   2        ; offset: $C (12)
  403. dbhDoubleBack             ds.l   1        ; offset: $14 (20)
  404. dbhFormat                 ds.l   1        ; offset: $18 (24)
  405. sizeof                     EQU *            ; size:   $1C (28)
  406.                         ENDR
  407.  
  408. ; typedef struct SndDoubleBufferHeader2  SndDoubleBufferHeader2
  409. ; typedef SndDoubleBufferHeader2  *SndDoubleBufferHeader2Ptr
  410. SoundInfoList             RECORD    0
  411. count                     ds.w   1        ; offset: $0 (0)
  412. infoHandle                 ds.l   1        ; offset: $2 (2)
  413. sizeof                     EQU *            ; size:   $6 (6)
  414.                         ENDR
  415.  
  416. ; typedef struct SoundInfoList  SoundInfoList
  417. ; typedef SoundInfoList     *SoundInfoListPtr
  418. CompressionInfo         RECORD    0
  419. recordSize                 ds.l   1        ; offset: $0 (0)
  420. format                     ds.l   1        ; offset: $4 (4)
  421. compressionID             ds.w   1        ; offset: $8 (8)
  422. samplesPerPacket         ds.w   1        ; offset: $A (10)
  423. bytesPerPacket             ds.w   1        ; offset: $C (12)
  424. bytesPerFrame             ds.w   1        ; offset: $E (14)
  425. bytesPerSample             ds.w   1        ; offset: $10 (16)
  426. futureUse1                 ds.w   1        ; offset: $12 (18)
  427. sizeof                     EQU *            ; size:   $14 (20)
  428.                         ENDR
  429.  
  430. ; typedef struct CompressionInfo  CompressionInfo
  431. ; typedef CompressionInfo     *CompressionInfoPtr
  432. ; typedef CompressionInfoPtr  *CompressionInfoHandle
  433. ; These two routines for Get/SetSoundVol should no longer be used.
  434. ; They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.
  435. ; Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.
  436.     IF OLDROUTINENAMES  ** ¬ GENERATINGCFM  THEN
  437. ;
  438. ; pascal void SetSoundVol(short level)
  439. ;
  440.     IF GENERATINGCFM THEN
  441.         IMPORT_CFM_FUNCTION    SetSoundVol
  442.     ENDIF
  443.  
  444. ;
  445. ; pascal void GetSoundVol(short *level)
  446. ;
  447.     IF ¬ GENERATINGCFM THEN
  448.         ; parameters: 
  449.         ;     level             => A0
  450.         Macro
  451.         _GetSoundVol
  452.             dc.w     $4218
  453.             dc.w     $10B8
  454.             dc.w     $0260
  455.         EndM
  456.     ELSE
  457.         IMPORT_CFM_FUNCTION    GetSoundVol
  458.     ENDIF
  459.  
  460.     ENDIF
  461. ;
  462. ; pascal OSErr SndDoCommand(SndChannelPtr chan, const SndCommand *cmd, Boolean noWait)
  463. ;
  464.     IF ¬ GENERATINGCFM THEN
  465.         _SndDoCommand:    OPWORD    $A803
  466.     ELSE
  467.         IMPORT_CFM_FUNCTION    SndDoCommand
  468.     ENDIF
  469.  
  470. ;
  471. ; pascal OSErr SndDoImmediate(SndChannelPtr chan, const SndCommand *cmd)
  472. ;
  473.     IF ¬ GENERATINGCFM THEN
  474.         _SndDoImmediate:    OPWORD    $A804
  475.     ELSE
  476.         IMPORT_CFM_FUNCTION    SndDoImmediate
  477.     ENDIF
  478.  
  479. ;
  480. ; pascal OSErr SndNewChannel(SndChannelPtr *chan, short synth, long init, SndCallBackUPP userRoutine)
  481. ;
  482.     IF ¬ GENERATINGCFM THEN
  483.         _SndNewChannel:    OPWORD    $A807
  484.     ELSE
  485.         IMPORT_CFM_FUNCTION    SndNewChannel
  486.     ENDIF
  487.  
  488. ;
  489. ; pascal OSErr SndDisposeChannel(SndChannelPtr chan, Boolean quietNow)
  490. ;
  491.     IF ¬ GENERATINGCFM THEN
  492.         _SndDisposeChannel:    OPWORD    $A801
  493.     ELSE
  494.         IMPORT_CFM_FUNCTION    SndDisposeChannel
  495.     ENDIF
  496.  
  497. ;
  498. ; pascal OSErr SndPlay(SndChannelPtr chan, SndListHandle sndHdl, Boolean async)
  499. ;
  500.     IF ¬ GENERATINGCFM THEN
  501.         _SndPlay:    OPWORD    $A805
  502.     ELSE
  503.         IMPORT_CFM_FUNCTION    SndPlay
  504.     ENDIF
  505.  
  506.     IF OLDROUTINENAMES  THEN
  507. ;
  508. ; pascal OSErr SndAddModifier(SndChannelPtr chan, Ptr modifier, short id, long init)
  509. ;
  510.     IF ¬ GENERATINGCFM THEN
  511.         _SndAddModifier:    OPWORD    $A802
  512.     ELSE
  513.         IMPORT_CFM_FUNCTION    SndAddModifier
  514.     ENDIF
  515.  
  516.     ENDIF
  517. ;
  518. ; pascal OSErr SndControl(short id, SndCommand *cmd)
  519. ;
  520.     IF ¬ GENERATINGCFM THEN
  521.         _SndControl:    OPWORD    $A806
  522.     ELSE
  523.         IMPORT_CFM_FUNCTION    SndControl
  524.     ENDIF
  525.  
  526. ; Sound Manager 2.0 and later, uses _SoundDispatch 
  527. ;
  528. ; pascal NumVersion SndSoundManagerVersion(void)
  529. ;
  530.     IF ¬ GENERATINGCFM THEN
  531.         Macro
  532.         _SndSoundManagerVersion
  533.             dc.w     $203C
  534.             dc.w     $000C
  535.             dc.w     $0008
  536.             dc.w     $A800
  537.         EndM
  538.     ELSE
  539.         IMPORT_CFM_FUNCTION    SndSoundManagerVersion
  540.     ENDIF
  541.  
  542. ;
  543. ; pascal OSErr SndStartFilePlay(SndChannelPtr chan, short fRefNum, short resNum, long bufferSize, void *theBuffer, AudioSelectionPtr theSelection, FilePlayCompletionUPP theCompletion, Boolean async)
  544. ;
  545.     IF ¬ GENERATINGCFM THEN
  546.         Macro
  547.         _SndStartFilePlay
  548.             dc.w     $203C
  549.             dc.w     $0D00
  550.             dc.w     $0008
  551.             dc.w     $A800
  552.         EndM
  553.     ELSE
  554.         IMPORT_CFM_FUNCTION    SndStartFilePlay
  555.     ENDIF
  556.  
  557. ;
  558. ; pascal OSErr SndPauseFilePlay(SndChannelPtr chan)
  559. ;
  560.     IF ¬ GENERATINGCFM THEN
  561.         Macro
  562.         _SndPauseFilePlay
  563.             dc.w     $203C
  564.             dc.w     $0204
  565.             dc.w     $0008
  566.             dc.w     $A800
  567.         EndM
  568.     ELSE
  569.         IMPORT_CFM_FUNCTION    SndPauseFilePlay
  570.     ENDIF
  571.  
  572. ;
  573. ; pascal OSErr SndStopFilePlay(SndChannelPtr chan, Boolean quietNow)
  574. ;
  575.     IF ¬ GENERATINGCFM THEN
  576.         Macro
  577.         _SndStopFilePlay
  578.             dc.w     $203C
  579.             dc.w     $0308
  580.             dc.w     $0008
  581.             dc.w     $A800
  582.         EndM
  583.     ELSE
  584.         IMPORT_CFM_FUNCTION    SndStopFilePlay
  585.     ENDIF
  586.  
  587. ;
  588. ; pascal OSErr SndChannelStatus(SndChannelPtr chan, short theLength, SCStatusPtr theStatus)
  589. ;
  590.     IF ¬ GENERATINGCFM THEN
  591.         Macro
  592.         _SndChannelStatus
  593.             dc.w     $203C
  594.             dc.w     $0510
  595.             dc.w     $0008
  596.             dc.w     $A800
  597.         EndM
  598.     ELSE
  599.         IMPORT_CFM_FUNCTION    SndChannelStatus
  600.     ENDIF
  601.  
  602. ;
  603. ; pascal OSErr SndManagerStatus(short theLength, SMStatusPtr theStatus)
  604. ;
  605.     IF ¬ GENERATINGCFM THEN
  606.         Macro
  607.         _SndManagerStatus
  608.             dc.w     $203C
  609.             dc.w     $0314
  610.             dc.w     $0008
  611.             dc.w     $A800
  612.         EndM
  613.     ELSE
  614.         IMPORT_CFM_FUNCTION    SndManagerStatus
  615.     ENDIF
  616.  
  617. ;
  618. ; pascal void SndGetSysBeepState(short *sysBeepState)
  619. ;
  620.     IF ¬ GENERATINGCFM THEN
  621.         Macro
  622.         _SndGetSysBeepState
  623.             dc.w     $203C
  624.             dc.w     $0218
  625.             dc.w     $0008
  626.             dc.w     $A800
  627.         EndM
  628.     ELSE
  629.         IMPORT_CFM_FUNCTION    SndGetSysBeepState
  630.     ENDIF
  631.  
  632. ;
  633. ; pascal OSErr SndSetSysBeepState(short sysBeepState)
  634. ;
  635.     IF ¬ GENERATINGCFM THEN
  636.         Macro
  637.         _SndSetSysBeepState
  638.             dc.w     $203C
  639.             dc.w     $011C
  640.             dc.w     $0008
  641.             dc.w     $A800
  642.         EndM
  643.     ELSE
  644.         IMPORT_CFM_FUNCTION    SndSetSysBeepState
  645.     ENDIF
  646.  
  647. ;
  648. ; pascal OSErr SndPlayDoubleBuffer(SndChannelPtr chan, SndDoubleBufferHeaderPtr theParams)
  649. ;
  650.     IF ¬ GENERATINGCFM THEN
  651.         Macro
  652.         _SndPlayDoubleBuffer
  653.             dc.w     $203C
  654.             dc.w     $0420
  655.             dc.w     $0008
  656.             dc.w     $A800
  657.         EndM
  658.     ELSE
  659.         IMPORT_CFM_FUNCTION    SndPlayDoubleBuffer
  660.     ENDIF
  661.  
  662. ; MACE compression routines 
  663. ;
  664. ; pascal NumVersion MACEVersion(void)
  665. ;
  666.     IF ¬ GENERATINGCFM THEN
  667.         Macro
  668.         _MACEVersion
  669.             dc.w     $203C
  670.             dc.w     $0000
  671.             dc.w     $0010
  672.             dc.w     $A800
  673.         EndM
  674.     ELSE
  675.         IMPORT_CFM_FUNCTION    MACEVersion
  676.     ENDIF
  677.  
  678. ;
  679. ; pascal void Comp3to1(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  680. ;
  681.     IF ¬ GENERATINGCFM THEN
  682.         Macro
  683.         _Comp3to1
  684.             dc.w     $203C
  685.             dc.w     $0004
  686.             dc.w     $0010
  687.             dc.w     $A800
  688.         EndM
  689.     ELSE
  690.         IMPORT_CFM_FUNCTION    Comp3to1
  691.     ENDIF
  692.  
  693. ;
  694. ; pascal void Exp1to3(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  695. ;
  696.     IF ¬ GENERATINGCFM THEN
  697.         Macro
  698.         _Exp1to3
  699.             dc.w     $203C
  700.             dc.w     $0008
  701.             dc.w     $0010
  702.             dc.w     $A800
  703.         EndM
  704.     ELSE
  705.         IMPORT_CFM_FUNCTION    Exp1to3
  706.     ENDIF
  707.  
  708. ;
  709. ; pascal void Comp6to1(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  710. ;
  711.     IF ¬ GENERATINGCFM THEN
  712.         Macro
  713.         _Comp6to1
  714.             dc.w     $203C
  715.             dc.w     $000C
  716.             dc.w     $0010
  717.             dc.w     $A800
  718.         EndM
  719.     ELSE
  720.         IMPORT_CFM_FUNCTION    Comp6to1
  721.     ENDIF
  722.  
  723. ;
  724. ; pascal void Exp1to6(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  725. ;
  726.     IF ¬ GENERATINGCFM THEN
  727.         Macro
  728.         _Exp1to6
  729.             dc.w     $203C
  730.             dc.w     $0010
  731.             dc.w     $0010
  732.             dc.w     $A800
  733.         EndM
  734.     ELSE
  735.         IMPORT_CFM_FUNCTION    Exp1to6
  736.     ENDIF
  737.  
  738. ; Sound Manager 3.0 and later calls 
  739. ;
  740. ; pascal OSErr GetSysBeepVolume(long *level)
  741. ;
  742.     IF ¬ GENERATINGCFM THEN
  743.         Macro
  744.         _GetSysBeepVolume
  745.             dc.w     $203C
  746.             dc.w     $0224
  747.             dc.w     $0018
  748.             dc.w     $A800
  749.         EndM
  750.     ELSE
  751.         IMPORT_CFM_FUNCTION    GetSysBeepVolume
  752.     ENDIF
  753.  
  754. ;
  755. ; pascal OSErr SetSysBeepVolume(long level)
  756. ;
  757.     IF ¬ GENERATINGCFM THEN
  758.         Macro
  759.         _SetSysBeepVolume
  760.             dc.w     $203C
  761.             dc.w     $0228
  762.             dc.w     $0018
  763.             dc.w     $A800
  764.         EndM
  765.     ELSE
  766.         IMPORT_CFM_FUNCTION    SetSysBeepVolume
  767.     ENDIF
  768.  
  769. ;
  770. ; pascal OSErr GetDefaultOutputVolume(long *level)
  771. ;
  772.     IF ¬ GENERATINGCFM THEN
  773.         Macro
  774.         _GetDefaultOutputVolume
  775.             dc.w     $203C
  776.             dc.w     $022C
  777.             dc.w     $0018
  778.             dc.w     $A800
  779.         EndM
  780.     ELSE
  781.         IMPORT_CFM_FUNCTION    GetDefaultOutputVolume
  782.     ENDIF
  783.  
  784. ;
  785. ; pascal OSErr SetDefaultOutputVolume(long level)
  786. ;
  787.     IF ¬ GENERATINGCFM THEN
  788.         Macro
  789.         _SetDefaultOutputVolume
  790.             dc.w     $203C
  791.             dc.w     $0230
  792.             dc.w     $0018
  793.             dc.w     $A800
  794.         EndM
  795.     ELSE
  796.         IMPORT_CFM_FUNCTION    SetDefaultOutputVolume
  797.     ENDIF
  798.  
  799. ;
  800. ; pascal OSErr GetSoundHeaderOffset(SndListHandle sndHandle, long *offset)
  801. ;
  802.     IF ¬ GENERATINGCFM THEN
  803.         Macro
  804.         _GetSoundHeaderOffset
  805.             dc.w     $203C
  806.             dc.w     $0404
  807.             dc.w     $0018
  808.             dc.w     $A800
  809.         EndM
  810.     ELSE
  811.         IMPORT_CFM_FUNCTION    GetSoundHeaderOffset
  812.     ENDIF
  813.  
  814. ;
  815. ; pascal UnsignedFixed UnsignedFixedMulDiv(UnsignedFixed value, UnsignedFixed multiplier, UnsignedFixed divisor)
  816. ;
  817.     IF ¬ GENERATINGCFM THEN
  818.         Macro
  819.         _UnsignedFixedMulDiv
  820.             dc.w     $203C
  821.             dc.w     $060C
  822.             dc.w     $0018
  823.             dc.w     $A800
  824.         EndM
  825.     ELSE
  826.         IMPORT_CFM_FUNCTION    UnsignedFixedMulDiv
  827.     ENDIF
  828.  
  829. ;
  830. ; pascal OSErr GetCompressionInfo(short compressionID, OSType format, short numChannels, short sampleSize, CompressionInfoPtr cp)
  831. ;
  832.     IF ¬ GENERATINGCFM THEN
  833.         Macro
  834.         _GetCompressionInfo
  835.             dc.w     $203C
  836.             dc.w     $0710
  837.             dc.w     $0018
  838.             dc.w     $A800
  839.         EndM
  840.     ELSE
  841.         IMPORT_CFM_FUNCTION    GetCompressionInfo
  842.     ENDIF
  843.  
  844. ;
  845. ; pascal OSErr SetSoundPreference(OSType theType, Str255 name, Handle settings)
  846. ;
  847.     IF ¬ GENERATINGCFM THEN
  848.         Macro
  849.         _SetSoundPreference
  850.             dc.w     $203C
  851.             dc.w     $0634
  852.             dc.w     $0018
  853.             dc.w     $A800
  854.         EndM
  855.     ELSE
  856.         IMPORT_CFM_FUNCTION    SetSoundPreference
  857.     ENDIF
  858.  
  859. ;
  860. ; pascal OSErr GetSoundPreference(OSType theType, Str255 name, Handle settings)
  861. ;
  862.     IF ¬ GENERATINGCFM THEN
  863.         Macro
  864.         _GetSoundPreference
  865.             dc.w     $203C
  866.             dc.w     $0638
  867.             dc.w     $0018
  868.             dc.w     $A800
  869.         EndM
  870.     ELSE
  871.         IMPORT_CFM_FUNCTION    GetSoundPreference
  872.     ENDIF
  873.  
  874. ; Sound Manager 3.1 and later calls 
  875. ;
  876. ; pascal OSErr SndGetInfo(SndChannelPtr chan, OSType selector, void *infoPtr)
  877. ;
  878.     IF ¬ GENERATINGCFM THEN
  879.         Macro
  880.         _SndGetInfo
  881.             dc.w     $203C
  882.             dc.w     $063C
  883.             dc.w     $0018
  884.             dc.w     $A800
  885.         EndM
  886.     ELSE
  887.         IMPORT_CFM_FUNCTION    SndGetInfo
  888.     ENDIF
  889.  
  890. ;
  891. ; pascal OSErr SndSetInfo(SndChannelPtr chan, OSType selector, void *infoPtr)
  892. ;
  893.     IF ¬ GENERATINGCFM THEN
  894.         Macro
  895.         _SndSetInfo
  896.             dc.w     $203C
  897.             dc.w     $0640
  898.             dc.w     $0018
  899.             dc.w     $A800
  900.         EndM
  901.     ELSE
  902.         IMPORT_CFM_FUNCTION    SndSetInfo
  903.     ENDIF
  904.  
  905.  
  906.     ENDIF ; __SOUND__
  907.